﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace DynDns
{
    public partial class login : System.Web.UI.Page
    {
        accounts ac;

        protected void Page_Load(object sender, EventArgs e)
        {
            ac = new accounts(); 
        }

        // Check Login
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string u = txtUserName.Value;
            string p = txtUserPass.Value;

            bool access = ac.access("USER", u, p);

            if (access == true)
            {
                // set Cookie, name, and roll as strCookiePath
                FormsAuthentication.RedirectFromLoginPage(u, chkPersistCookie.Checked, ac.getRoll());
            }


        }
    }
}